<?php

namespace app\api\validate;

use think\Validate;

class Admin extends Validate
{

    /**
     * 验证规则
     */
    protected $rule = [
        'account|账号' => 'require|min:8|unique:admin',
        'password|密码' => 'require|regex:\S{32}',
    ];

    /**
     * 场景
     */
    protected $scene = [
        'add'   =>  ['account','password'],
        'edit'  =>  ['account'=>'require|min:8'],
    ]; 
}
